# coding=utf-8
"""
Created on 2010-8-8

@author: morningbzy
"""

from sgs.figure.figure_base import FigureBase
from sgs.common.constants import cardColor
from sgs.skill.skill_base import SkillBase
from sgs.card.sha import Sha

class GuanYu(FigureBase):
    def __init__(self):
        super(GuanYu, self).__init__()
        self.name = '关羽'
        self.hp = 4
        self.skillList = [WuSheng()]

class WuSheng(SkillBase):
    name = '武圣'

    def action(self, cond, src, args):
        cards, target = src.callGameAction('requireCard', cond,
                condition={'color': [cardColor.HEART,
                                     cardColor.DIANMOND]},
                msg='你使用了技能【武圣】，请选择一张红牌')
        if cards:
            card = cards[0]
            fakeCard = Sha(card.color, card.point, card.cardType)
            fakeCard.setId(card.id)
            fakeCard.setOriginalCard([card])
            fakeCard.action(cond, src, target)
